# TODO: Add comment
# 
# Author: rogb
###############################################################################

setClass("BasicInstrument",
	contains=c("Currency","Name")
)

BasicInstrument <- function(Currency,Name){
	new("BasicInstrument",Currency=Currency,Name=Name)	
}

setMethod("show","BasicInstrument",function(object){
			cat("Basic Instrument\n",sep="")
			cat("Currency: ",paste(object@Currency,collapse=", "),"\n",sep="")
			cat("Name    : ",paste(object@Name,collapse=", "),"\n",sep="")
		})

setMethod("length","BasicInstrument",function(x){
			length(x@Currency)
		})

info <- function(object){
			paste(object@Currency,object@Name,sep="::")
		}

"info<-" <- function(object,value){
			tmp <- unlist(strsplit(value,"::"))
			Currency <- tmp[1]
			Name <- tmp[2]
			object@Currency <- Currency
			object@Name <- Name
			object
		}

###############################################################################
		